<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Blog extends Model
{
    protected $table = 'blog';
    protected $dateFormat = 'U';

    const UPDATED_AT = 'create_time';
    const CREATED_AT = 'update_time';

    protected $fillable = [
        'title',
        'sub_description',
        'description',
        'create_time',
        'update_time',
        'view',
        'link',
        'uuid',
        'type_id',
        'description_html',
        'user_id',
        'cover'
    ];

    function user() {
        return $this->belongsTo(User::class, 'user_id', 'id');
    }


}
